#define _CRT_SECURE_NO_WARNINGS 1

#include"List.h"

void TestList1()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);
	LTPopBack(plist);
	LTPrint(plist);
	LTPushFront(plist, 29);
	LTPrint(plist);
	
	LTInsert(plist->next, 40);
	LTPrint(plist);
	LTInsert(plist, 50);
	LTPrint(plist);
}

void TestList2()
{
	LTNode* plist = LTInit();
	LTPushBack(plist, 1);
	LTPushBack(plist, 2);
	LTPushBack(plist, 3);
	LTPushBack(plist, 4);
	LTPrint(plist);
	LTNode* pos = LTFind(plist, 3);
	if (pos)
	{
		LTErase(pos);
		pos = NULL;
	}
	LTPrint(plist);
	LTPopFront(plist);
	LTPrint(plist);
	LTDestroy(plist);
	plist = NULL;
}

int main()
{
	TestList1();
	TestList2();
	return 0;
}